// C05:5.14:waiting.cpp -- using clock() in a time-delay loop
#include <bits/types/clock_t.h>
#include <iostream>
#include <ctime>

int main(void)
{
    using namespace std;
    cout << "Enterthe delay time, in seconds: ";
    float secs;
    cin >> secs;
    // convert to clock ticks
    clock_t delay = secs * CLOCKS_PER_SEC;
    cout << "starting\a\n";
    clock_t start = clock();
    while(clock() - start < delay)
    {
        // wait until time elapses
        // note the semicolon
        ;
    }
    cout << "done! \a\n";
}